package com.vhall.component.entity.room.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author jingwen.li
 * @date 2022/2/15
 */
@Data
public class PushStreamReqVO implements Serializable {


    private Integer id;

    @NotBlank(message = "room_id不能为空!")
    @JsonProperty(value = "room_id")
    @ParamName("room_id")
    private String roomId;

    @Length(max = 30, message = "社媒名称不符合规范!")
    @JsonProperty(value = "name")
    private String name;

    @JsonProperty(value = "key")
    private String key;

    @NotNull(message = "推流类型不能为空!")
    @JsonProperty(value = "type")
    @Range(min = 0, max = 1, message = "type只能是0或1!")
    private Integer type;

    @NotBlank(message = "stream url不能为空!")
    @JsonProperty(value = "rtmps")
    private String rtmps;

    @JsonProperty(value = "cron_push_time")
    @ParamName("cron_push_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cronPushTime;
}
